package org.keshe.controllers;

import javafx.application.Platform;
import javafx.event.ActionEvent;
import javafx.fxml.FXML;
import javafx.fxml.Initializable;
import javafx.scene.control.Button;
import javafx.scene.control.Label;
import org.keshe.CurrentUser;
import org.keshe.gui.PublicStages;

import java.net.URL;
import java.util.ResourceBundle;

public class AdminMenu implements Initializable {

    @FXML
    private Label label;

    @FXML
    private Button changePwd;

    @FXML
    private Button manageStu;

    @FXML
    private Button inStu;

    @FXML
    private Button outStu;

    @FXML
    private Button exit;

    @Override
    public void initialize(URL url, ResourceBundle resourceBundle) {
        label.setText("您好！管理员 " + CurrentUser.USER.getUserName());
    }
    @FXML
    void changePwdClick(ActionEvent event) {
        PublicStages.CHANGEPASSWD.show();
    }

    @FXML
    void exitClick(ActionEvent event) {
        Platform.exit();
    }

    public void manageStuClick(ActionEvent event) {
        PublicStages.ADMINSTUMANAGE.show();
    }
    @FXML
    public void inStuClick(ActionEvent event) {
        PublicStages.INSTU.show();
    }
    @FXML
    public void outStuClick(ActionEvent event) {
        PublicStages.OUTSTU.show();
    }
}
